package cn.tedu.sp09.feign;


import cn.tedu.sp01.pojo.Item;
import cn.tedu.web.util.JsonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
//调用向eureka注册的item-service服务器;
@FeignClient(name="item-service",fallback =ItemClientFB.class)//降级类
public interface ItemClient {

    @GetMapping("/{orderId}")//调用item-service服务器中的"/{orderId}"这个请求业务
    JsonResult<List<Item>> getItems(@PathVariable String orderId);
    @PostMapping("/decreaseNumber")
    JsonResult<?> decreaseNumber(@RequestBody List<Item> items);

}
